From a512f0b8419e248b557e5d4bc44017dcb26d2a19 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 1 Feb 1999 21:05:32 +0000 Subject: [PATCH] Cast uints to ints in geometry calculations. This should prevent FP Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints to ints in geometry calculations. This should prevent FP exceptions on FreeBSD when quantities become negative. [ Actually, this is probably a workaround with a gcc bug with handling of bitfields, according to Ben Jackson ] --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-0 | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gtk/gtklabel.c | 18 ++++++++++-------- 8 files changed, 73 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e81683d25b..27fad15951 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Feb 1 14:54:28 1999 Owen Taylor + + * gtk/gtklabel.c (gtk_label_expose): Cast uints + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] + Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index e81683d25b..27fad15951 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +Mon Feb 1 14:54:28 1999 Owen Taylor + + * gtk/gtklabel.c (gtk_label_expose): Cast uints + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] + Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e81683d25b..27fad15951 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Mon Feb 1 14:54:28 1999 Owen Taylor + + * gtk/gtklabel.c (gtk_label_expose): Cast uints + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] + Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index e81683d25b..27fad15951 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Mon Feb 1 14:54:28 1999 Owen Taylor + + * gtk/gtklabel.c (gtk_label_expose): Cast uints + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] + Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e81683d25b..27fad15951 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Mon Feb 1 14:54:28 1999 Owen Taylor + + * gtk/gtklabel.c (gtk_label_expose): Cast uints + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] + Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e81683d25b..27fad15951 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Mon Feb 1 14:54:28 1999 Owen Taylor + + * gtk/gtklabel.c (gtk_label_expose): Cast uints + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] + Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e81683d25b..27fad15951 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Mon Feb 1 14:54:28 1999 Owen Taylor + + * gtk/gtklabel.c (gtk_label_expose): Cast uints + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] + Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 7c3fc744ea..d241657495 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -927,14 +927,16 @@ gtk_label_expose (GtkWidget *widget, gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area); gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area); - x = floor (widget->allocation.x + misc->xpad + - ((widget->allocation.width - label->max_width - 2 * misc->xpad) - * misc->xalign) + 0.5); - - y = floor (widget->allocation.y - + (widget->allocation.height - - widget->requisition.height) * misc->yalign - + misc->ypad + 0.5); + x = floor (widget->allocation.x + (gint)misc->xpad + + (((gint)widget->allocation.width - + (gint)label->max_width - 2 * (gint)misc->xpad) + * misc->xalign) + 0.5); + + y = floor (widget->allocation.y + (gint)misc->ypad + + (((gint)widget->allocation.height + - (gint)widget->requisition.height) + * misc->yalign) + 0.5); + for (word = label->words; word; word = word->next) { gchar save = word->beginning[word->length]; -- 2.30.2